//
//  KDTableViewCell.h
//  M800Project
//
//  Created by 姚宗超 on 14/11/6.
//  Copyright (c) 2014年 姚宗超. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol KDTableViewCell <NSObject>
@required
@property (nonatomic, strong) id object;
//@property (nonatomic, strong) NSIndexPath *indexPath;

+ (CGFloat)rowHeightForObject:(id)object;

+ (CGFloat)estimateRowsHeight;

+ (BOOL)shouldUseAutoLayout;

@end

@interface KDTableViewCell : UITableViewCell <KDTableViewCell>

@property (nonatomic, strong) id		object;
//@property (nonatomic, strong) NSIndexPath *indexPath;

+ (CGFloat)rowHeightForObject:(id)object;

+ (CGFloat)estimateRowsHeight;


// 用autolayout自适应高度还是手动计算高度，为了兼容之前手动计算高度的代码
+ (BOOL)shouldUseAutoLayout;

//object属性observer相关
/*开始监听object属性,在subclass中通过该方法可自定义添加监听的属性*/
- (void)startObserveObjectProperty;
/*清除监听,在subclass中应该清除已添加的属性*/
- (void)finishObserveObjectProperty;

/*监听一个属性*/
- (void)addObservedProperty:(NSString *)property;
/*移出监听*/
- (void)removeObservedProperty:(NSString *)property;

@end
